<template>
	<mu-container class="container">
		<van-steps :active="activeStep">
			<van-step>填写信息</van-step>
			<van-step>确认样本</van-step>
			<van-step>上传文件</van-step>
			<van-step>支付订单</van-step>
		</van-steps>
		<van-form @submit="submit">
			<div class="firstStep" v-show="activeStep === 0">
				<van-field
					readonly
					clickable
					:disabled="curMode == 'edit'"
					name="area"
					:value="validateForm.procityname"
					label="项目地区"
					placeholder="点击选择项目地区"
					@click="selectCity"
					:rules="[{ required: true, message: '请选择项目地区' }]"
				/>
				<van-popup v-model="procitynameshow" position="bottom">
					<van-area
						:area-list="areaList"
						:columns-num="2"
						@confirm="selectCityConfirm($event,'procityname')"
						@cancel="procitynameshow = false"
					/>
				</van-popup>

				<van-field
					readonly
					clickable
					:disabled="curMode == 'edit'"
					name="picker"
					:value="validateForm.jyzxname"
					label="开标地点"
					placeholder="点击选择开标地点"
					@click="selectJyzx"
					:rules="[{ required: true, message: '请选择开标地点' }]"
				/>
				<van-popup v-model="jyzxnameshow" position="bottom" :lazy-render="false">
					<van-picker
						show-toolbar
						:columns="ggzyjyzxColumns"
						@confirm="selectJyzxConfirm($event,'jyzxname')"
						@cancel="jyzxnameshow = false"
						ref="selectJyzxPicker"
					/>
				</van-popup>

				<van-field
					readonly
					clickable
					name="picker"
					:disabled="curMode == 'edit'"
					:value="validateForm.dbgs"
					label="担保公司"
					placeholder="点击选择担保公司"
					@click="selectVendor"
					:rules="[{ required: true, message: '请选择担保公司' }]"
				/>
				<van-popup v-model="dbgsshow" position="bottom" :lazy-render="false">
					<van-picker
						show-toolbar
						:columns="vendorColumns"
						@confirm="selectVendorConfirm($event,'dbgs')"
						@cancel="dbgsshow = false"
						ref="selectDbgsPicker"
						:loading="loading"
					/>
				</van-popup>

				<van-field
					readonly
					clickable
					name="picker"
					:value="validateForm.bhgs"
					label="保函格式"
					placeholder="点击选择保函格式"
					@click="selectBhgs"
					:rules="[{ required: true, message: '请选择保函格式' }]"
				/>
				<van-popup v-model="bhgsshow" position="bottom" :lazy-render="false">
					<van-picker
						show-toolbar
						:columns="bhgsColumns"
						@confirm="selectBhgsConfirm($event,'bhgs')"
						@cancel="bhgsshow = false"
						ref="selectBhgsPicker"
					/>
				</van-popup>

				<van-field
					readonly
					clickable
					name="picker"
					:value="validateForm.bhmb"
					label="保函模板"
					placeholder="点击选择保函模板"
					@click="selectBhmb"
					:rules="[{ required: true, message: '请选择保函模板' }]"
				/>
				<van-popup v-model="bhmbshow" position="bottom" :lazy-render="false">
					<van-picker
						show-toolbar
						:columns="bhmbColumns"
						@confirm="selectBhmbConfirm($event,'bhmb')"
						@cancel="bhmbshow = false"
						ref="selectBhmbPicker"
					/>
				</van-popup>

				<van-field
					v-model="validateForm.bidder"
					name="企业名称"
					label="企业名称"
					placeholder="企业名称"
					:rules="[{ required: true, message: '请填写企业名称' }]"
				/>

				<van-field
					v-model="validateForm.bidsection"
					name="项目名称"
					label="项目名称"
					placeholder="项目名称"
					:rules="[{ required: true, message: '请填写项目名称' }]"
				/>

				<van-field
					v-model="validateForm.zbdlname"
					name="招标代理"
					label="招标代理"
					placeholder="招标代理"
					:rules="[{ required: true, message: '请填写招标代理' }]"
				/>

				<van-field
					v-model="validateForm.tenderee"
					name="招标人"
					label="招标人"
					placeholder="招标人"
					:rules="[{ required: true, message: '请填写招标人' }]"
				/>

				<van-field
					readonly
					v-model="validateForm.kbtime"
					name="开标时间"
					label="开标时间"
					placeholder="开标时间"
					:rules="[{ required: true, message: '请填写开标时间' }]"
					@click="kbtimePicker = true"
				/>
				<van-popup v-model="kbtimePicker" position="bottom">
					<van-datetime-picker
						type="datetime"
						@confirm="kbtimeConfirm"
						@cancel="kbtimePicker = false"
						:min-date="new Date()"
					/>
				</van-popup>

				<van-field
					v-model="validateForm.indatenum"
					name="保函天数"
					label="保函天数"
					placeholder="保函天数"
					:rules="[{ required: true, message: '请填写保函天数' }]"
				>
					<template #extra >
						天
					</template>
				</van-field>

				<van-field
					v-model="validateForm.enddate"
					name="有效日期"
					label="有效日期"
					placeholder="有效日期"
					:disabled="true"
				/>

				<van-field
					v-model="validateForm.earnest"
					name="担保金额"
					label="担保金额"
					placeholder="担保金额"
					:rules="[{ required: true, message: '请填写担保金额' }]"
				>
					<template #extra >
						万元
					</template>
				</van-field>

				<van-field
					v-model="validateForm.amount"
					name="订单金额"
					label="订单金额"
					placeholder="订单金额"
					:rules="[{ required: true, message: '请填写订单金额' }]"
					:disabled="true"
				>
					<template #extra >
						元
					</template>
				</van-field>
			</div>

			<div class="secondStep" v-show="activeStep === 1">
				<bhtemplate ref="resolve" v-model="validateForm" :data28="data28" @tempok="show"></bhtemplate>
			</div>

			<div class="thirdStep" v-if="activeStep === 2">
				<van-field name="uploader" :label="item.filename"  v-for="(item,index) in fileList" :key="index">
					<template #input>
						<van-uploader v-model="preFileList[index]" :after-read="($event)=>{afterRead($event,item,index)}" :max-count="1" @delete="delFile(index)">
							<van-button icon="plus" type="primary">上传扫描件</van-button>
						</van-uploader>
					</template>
				</van-field>
			</div>

			<div class="thirdStep" v-if="activeStep === 3">
				支付
			</div>

			<div style="margin: 16px;">
				<van-button round block type="info" native-type="submit">{{btnText}}</van-button>
				
			</div>
		</van-form>
		<van-button round block type="info" @click="activeStep--" v-if="activeStep>0">返回</van-button>
	</mu-container>
</template>
<script>
	import {
		mapState,
		mapGetters,
		mapActions
	} from 'vuex';
	import areaList from '@/js/city.js'

export default {
    props: ['rowguid'],
    data() {
		return {
			validateForm: {
				procitycode:"",
				procityname:"",
				dbgs:"",
				jyzxname:"",
				earnest:"",
				guaranteetype:"tbbh",
				agencytype:"dbjg",
				guaranteemedia:"dz",
				guaranteeformate:"",
				ordersrc:"bht",
				kbtime:"",
				indatenum:"",
				shbj:"1",
				bhgs:"",
				bhgscode:"",
				bhmb:"",
				zbdlname: this.$route.query.zbdlname,
				tenderee: this.$route.query.tenderee,
				indatenum:"",
				amount:"",
				vendorid:"",
				bidsection: this.$route.query.bidsection,
				bidder: this.$route.query.bidder
			},

			procitynameshow:false,
			showPicker:false,
			jyzxnameshow:false,
			dbgsshow:false,
			bhgsshow:false,
			bhmbshow:false,
			bhTemplate:false,
			kbtimePicker:false,

			areaList:areaList,
			ggzyjyzxColumns: [],
			vendorColumns: [],
			bhgsColumns: [],
			bhmbColumns: [],

			passFrRules: [{
				validate: (val) => !!val,
				message: '必须填写法人名称'
			}, ],
			
			activeStep:0,

			curVendorinfo:{},
			vendorList:[],
			fileList:[],
			preFileList:[],
			mailaddress:"",
			choseBh:{},
			promptInfo:"",
			data28:[],
			uploader:[],
			loading:false,
			
			curMode:'add',

			btnText:"确认",
		}
    },
	watch:{

		"validateForm.earnest":function(n,o){
			this.handlePrice();
		},

		"validateForm.indatenum":function(n,o){
			if(this.validateForm.kbtime !== ""){
				var date = new Date(this.validateForm.kbtime.replace(/\-/ig, '/')).getTime();
                this.validateForm.enddate = this.timestampToTime(date + (this.validateForm.indatenum-1) * 86400000);
			}
		},

		"validateForm.kbtime":function(n,o){
			if(this.validateForm.indatenum !== ""){
				var date = new Date(this.validateForm.kbtime.replace(/\-/ig, '/')).getTime();
                this.validateForm.enddate = this.timestampToTime(date + (this.validateForm.indatenum-1) * 86400000);
			}
		},
		activeStep:function(n,o){
			if(n === 2){
				this.btnText = "创建订单"
			}else if(n < 2){
				this.btnText = "确认"
			}
		},
	},
    methods: {
		kbtimeConfirm(val) {
			let date = new Date(val);
			let y = date.getFullYear();
			let m = date.getMonth()+1;
			let d = date.getDate();
			let h = date.getHours();
			let min = date.getMinutes();
			this.validateForm.kbtime = y + "-" + (m < 10 ? ('0' + m) : m) + "-" + (d < 10 ? ('0' + d) : d) + " " + (h < 10 ? ('0' + h) : h) + ":" + (min < 10 ? ('0' + min) : min) +":00";
			if(h == 0 && min == 0){
				this.$dialog.alert({
					message: '开标时间不正确',
				})
				this.validateForm.kbtime = "";
			}
			this.kbtimePicker = false;
		},

		selectCity(){
			if(this.curMode == 'edit'){return}
			this.validateForm.jyzxname = "";
			this.procitynameshow = true
			
		},
		selectCityConfirm($event,type){
			var that = this;
			this.validateForm.procityname = $event.filter((item) => !!item).map((item) => item.name).join('-');
			this.validateForm.procitycode = $event.pop().code;
			that.ggzyjyzxColumns = [];
			that[type + 'show'] = false;
			
		},

		selectJyzx() {
			if(this.curMode == 'edit'){return}
			var that = this;
			if(!!this.validateForm.procityname){
				this.validateForm.dbgs = "";
				this.jyzxnameshow = true;
				this.loading = true;
				this.$api.getjyzx({
					citycode: that.validateForm.procitycode
				}).then(function (data) {
					for (var i = 0; i < data.length; i++) {
						that.ggzyjyzxColumns[i] = {};
						that.ggzyjyzxColumns[i].text = data[i].jyzxname;
						that.ggzyjyzxColumns[i].key = data[i].jyzxname;
					}
					that.$refs.selectJyzxPicker.setColumnValues(0,that.ggzyjyzxColumns);
					that.loading = false;
				})
			}else{
				this.$dialog.alert({
					message: '请先选择项目地区',
				})
			}
		},
		selectJyzxConfirm($event,type) {
			this.validateForm[type] = $event.text;
			this.validateForm.kbarea = $event.text;
			var that = this;
			that[type + 'show'] = false;
			this.$api.getVendorInfo({
                ordersrc: "wxgzh",
                procitycode: this.validateForm.procitycode,
                proname: this.validateForm.projectname,
                jyzxname: this.validateForm.jyzxname,
                guaranteetype: this.validateForm.guaranteetype,
                agencytype: this.validateForm.agencytype,
                guaranteemedia: this.validateForm.guaranteemedia,
			}).then(function (data) {
				that.curVendorinfo = data[0];

				data.forEach((item,index)=>{
					that.vendorColumns[index] = {};
					that.vendorColumns[index] = item;
					that.vendorColumns[index].text = item.vendorname;
				})
				that.$refs.selectDbgsPicker.setColumnValues(0,that.vendorColumns);
				that[type + 'show'] = false;
			})
		},

		selectVendor(){
			if(this.curMode == 'edit'){return}
			var that = this;
			if(!!this.validateForm.jyzxname){
				this.validateForm.bhgs = "";
				this.dbgsshow = true;
				this.loading = true;
				this.$api.getVendorInfo({
					ordersrc: "wxgzh",
					procitycode: this.validateForm.procitycode,
					proname: this.validateForm.projectname,
					jyzxname: this.validateForm.jyzxname,
					guaranteetype: this.validateForm.guaranteetype,
					agencytype: this.validateForm.agencytype,
					guaranteemedia: this.validateForm.guaranteemedia,
				}).then(function (data) {
					that.curVendorinfo = data[0];

					data.forEach((item,index)=>{
						that.vendorColumns[index] = {};
						that.vendorColumns[index] = item;
						that.vendorColumns[index].text = item.vendorname;
					})
					that.$refs.selectDbgsPicker.setColumnValues(0,that.vendorColumns);
					that.loading = false;
				})
			}else{
				this.$dialog.alert({
					message: '请先选择开标地点',
				})
			}
			
		},
		selectVendorConfirm($event,type) {
			var that = this;
			this.curVendorinfo = $event;
			this.validateForm.dbgs = $event.text;
			that[type + 'show'] = false;
			// this.$api.getOrderdetail({
                
			// }).then(function (data) {
			// 	that.common.mixin(that.validateForm, data.orderinfo);
			// 	that.validateForm = data.orderinfo;
			// 	that[type + 'show'] = false;
			// 	that.getBhgs(that.curVendorinfo);
			// })
		},

		selectBhgs(){
			var that = this;
			if(!!this.validateForm.dbgs){
				this.validateForm.bhmb = "";
				this.bhgsshow = true;
				this.loading = true;
				this.$api.getOrderdetail({
					
				}).then(function (data) {
					that.common.mixin(that.validateForm, data.orderinfo);
					that.validateForm = data.orderinfo;
					
					that.getBhgs(that.curVendorinfo);
				})
			}else{
				this.$dialog.alert({
					message: '请先选择担保公司',
				})
			}
		},
		selectBhgsConfirm($event,type) {
			var that = this;
			this.validateForm.bhgs = $event.text;
			this.validateForm.bhgscode = $event.valueid;
            //获取保函格式
			that[type + 'show'] = false;
            that.getApplylist(that.validateForm.vendorid);
		},

		selectBhmb(){
			var that = this;
			if(!!this.validateForm.bhgs){
				this.bhmbshow = true;
				this.loading = true;
				//获取保函格式
				this.$api.getbhtemplate({
					vendorid:that.validateForm.vendorid,
					bhlx:"tbbh",
					chjg:"dbjg",
					bhgs:that.validateForm.bhgscode,
					bhjz:"dz"
				}).then(function (data) {
					var dataintemp = [];
					if(data.length == 0){
						that.bhmbColumns = [];
					}else{
						that.data28 = data;
						for(var i = 0;i < data.length;i++){
							dataintemp[i] = {};
							dataintemp[i].samplename = data[i].samplename;
							dataintemp[i].sample = data[i].sample;
							dataintemp[i].sampleid = data[i].sampleid;
							dataintemp[i].curindex = i;
							dataintemp[i].text = data[i].samplename;
						}

						that.$refs.selectBhmbPicker.setColumnValues(0,dataintemp);
						that.validateForm.curBhtemplate = data[0].samplename;
						that.validateForm.sample = data[0].sample;          //将sample和sampleid存入form表单，creatorder接口调用
						that.validateForm.sampleid = data[0].sampleid;
					}
					that.loading = false;
				})
			}else{
				this.$dialog.alert({
					message: '请先选择保函格式',
				})
			}
		},

		selectBhmbConfirm($event,type) {
			this.validateForm.bhmb = $event.text;
			this.validateForm.bhmbIndex = $event.curindex;
			this[type + 'show'] = false;
		},


		getBhgs(vendorinfo){
			var that = this;

            var keyArr = ['vendorid', 'vendorname', 'guaranteecode', 'tbwtbzhtcode'];
            keyArr.forEach(function(key) {
                that.validateForm[key] = vendorinfo[key];
            });
            that.choseBh = vendorinfo;
            //计算金额
            //that.handlePrice(vendorinfo.price, vendorinfo);


            // that.getApplylist(that.validateForm.vendorid);
            
            //获取保函格式
			this.$api.getbhgs({
                vendorid:this.validateForm.vendorid,
				bhlx:"tbbh",
				chjg:"dbjg"
			}).then(function (data) {
				data.forEach((item,index)=>{
					that.bhgsColumns[index] = {};
					that.bhgsColumns[index] = item;
					that.bhgsColumns[index].text = item.valuename;
				})
				that.$refs.selectBhgsPicker.setColumnValues(0,that.bhgsColumns);
				that.loading = false;
			})

            // that.guaranteecode = that.validateForm.guaranteecode;
            // that.tenderee = that.validateForm.tenderee;
            // that.bidder = that.validateForm.bidder;
            // that.bidsection = that.validateForm.bidsection;
            // that.endData = that.validateForm.endData;
            // that.vendorname = that.validateForm.vendorname;
            that.bhTemplate = true;
            //that.data28w = that.getBhmb();
		},

		getApplylist(){
			var that = this;
			this.$api.applyfilelist({
                vendorid: this.curVendorinfo.vendorid,
                guaranteeid: this.validateForm.rowguid,
				guaranteetype: "tbbh",
                agencytype: "dbjg",
                guaranteemedia: "dz",
				// guaranteeformate: this.validateForm.guaranteeformate,
                guaranteeformate: this.validateForm.bhgscode,
				isMobile: true,
			}).then(function (data) {
                that.fileList = data.filelist;
                that.mailaddress = data.mailaddress;
			})
		},

		handlePrice(){
			
			if(!this.choseBh.vendorid || !this.validateForm.earnest) return;
			var that = this;
            var banklist = this.choseBh.banklist || [];
            if (this.validateForm.vendorid) {
				this.$api.computeprice({
					feetype: '服务费',
                    vendorcode: that.choseBh.vendorid,
                    bankcode: (banklist[0] || {}).bankid,
                    earnest: that.validateForm.earnest,
                    guaranteetype: that.validateForm.guaranteetype,
                    agencytype: that.validateForm.agencytype,
                    guaranteemedia: that.validateForm.guaranteemedia,
                    // guaranteeformate: that.validateForm.guaranteeformate,
                    guaranteeformate:that.validateForm.bhgscode,
				}).then(function (data) {
					that.validateForm.amount = data.price;
                    that.choseBh.price = data.price;
				})
            };
		},

		getBhmb(){
            var that = this;
            //获取保函格式
			this.$api.getbhtemplate({
				vendorid:that.validateForm.vendorid,
				bhlx:"tbbh",
				chjg:"dbjg",
				bhgs:that.validateForm.bhgscode,
				bhjz:"dz"
			}).then(function (data) {
                var dataintemp = [];
                if(data.length == 0){
                    that.bhmbColumns = {};
                }else{
                    for(var i = 0;i < data.length;i++){
                        dataintemp[i] = {};
                        dataintemp[i].samplename = data[i].samplename;
                        dataintemp[i].sample = data[i].sample;
                        dataintemp[i].sampleid = data[i].sampleid;
                        dataintemp[i].curindex = i;
						dataintemp[i].text = data[i].samplename;
                    }

					that.$refs.selectBhgsPicker.setColumnValues(0,that.dataintemp);
                    that.validateForm.curBhtemplate = data[0].samplename;
                    that.validateForm.sample = data[0].sample;          //将sample和sampleid存入form表单，creatorder接口调用
                    that.validateForm.sampleid = data[0].sampleid;
                }
                return data;
			})
        },

		afterRead($event,item,index) {
			var that = this;
			var formdata = new FormData();
			formdata.append("file",$event.file);
			formdata.append("fileguid",item.fileguid);
			formdata.append("vendorid",that.validateForm.vendorid);
			formdata.append("guaranteeid",that.validateForm.rowguid);
			formdata.append("filevendorid",item.filevendorid);
			formdata.append("filevendorname",item.filename);
			this.$api.w_uploadfile(formdata).then(function (data) {
				that.$notify({
					type:"success",
					message: item.filename + "上传成功"
				});
				that.fileList[index].isupload = true;
			})
		},

		//删除文件
		delFile(index){
			this.fileList[index].isupload = false;
		},

		timestampToTime: function (timestamp) {
            var date = new Date(timestamp); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
            var Y = date.getFullYear() + '-';
            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) +
            '-';
            var D = date.getDate();
            if (D <= 9) {
                D = '0' + D
            }
            return Y + M + D;
        },

		createOrder(){
			var that = this;
			for(let i = 0;i < this.fileList.length;i++){
				if(this.fileList[i].isupload !== true){
					that.$notify({
						type:"warning",
						message: "请上传" + this.fileList[i].filename
					});
					return
				}
			}
			this.curMode == 'add' ? this.validateForm.shbj = "1" : this.validateForm.shbj = "3";
			this.$api.createorder(this.validateForm).then(function (data,res) {
				if(data.code != 'error'){
					that.$notify({
						type:"success",
						message: "创建订单成功"
					});
					that.$router.push({
						path: '/pay',
						query: {
							id: that.validateForm.rowguid
						}
					})
				}
                
			})
		},

		//编辑情况下获取详情
		getDetail(rowguid){
			let _this = this;
			
			this.$api.orderdetail({
				rowguid: rowguid
			}).then(function (res) {
				//基础信息赋值
				_this.common.mixin(res.orderinfo,_this.validateForm,true);
				//开标地点
				_this.validateForm.jyzxname = res.orderinfo.kbarea;
				//担保公司
				_this.validateForm.dbgs = res.orderinfo.vendorname;
				
				//获取当前保函担保公司信息  传入担保公司ID  获取对应所有信息
				_this.getDbgsInfo(res.orderinfo.vendorid);
				//获取当前保函格式信息
				_this.getBhgsInfo(res.orderinfo.guaranteeformate);
				//获取当前保函模板信息
				_this.getBhmbInfo(res.orderinfo.sampleid);
				//获取当前保函文件信息
				_this.fileList = res.orderfile;
				res.orderfile.forEach((item,i)=>{
					let citem = item;
					citem.url = item.fileurl;
					_this.preFileList[i] = [citem];
					_this.fileList[i].isupload = true;
				})

				// _this.orderinfo = res.orderinfo;

			})
		},

		//获取担保公司数组信息
		getDbgsInfo(vendorid){
			var that = this;
			this.$api.getVendorInfo({
				ordersrc: "wxgzh",
				procitycode: this.validateForm.procitycode,
				proname: this.validateForm.projectname,
				jyzxname: this.validateForm.jyzxname,
				guaranteetype: this.validateForm.guaranteetype,
				agencytype: this.validateForm.agencytype,
				guaranteemedia: this.validateForm.guaranteemedia,
			}).then(function (data) {
				data.forEach((item,index)=>{
					if(vendorid == item.vendorid){
						that.curVendorinfo = item;
						that.choseBh = item;
					}
					
				})
			})
		},

		//获取当前保函格式
		getBhgsInfo(id){
			var that = this;
			this.$api.getbhgs({
                vendorid:this.validateForm.vendorid,
				bhlx:"tbbh",
				chjg:"dbjg"
			}).then(function (data) {
				data.forEach((item,index)=>{
					if(id == item.valueid){
						that.validateForm.bhgs = item.valuename;
						that.validateForm.bhgscode = item.valueid;
					}
				})
			})
		},

		//获取当前保函模板
		getBhmbInfo(mbid){
			var that = this;
			this.$api.getbhtemplate({
				vendorid:that.validateForm.vendorid,
				bhlx:"tbbh",
				chjg:"dbjg",
				bhgs:that.validateForm.guaranteeformate,
				bhjz:"dz"
			}).then(function (data) {
				var dataintemp = [];
				if(data.length == 0){
					that.bhmbColumns = [];
				}else{
					that.data28 = data;
					for(var i = 0;i < data.length;i++){
						if(mbid == data[i].sampleid){
							that.validateForm.curBhtemplate = data[i].samplename;
							that.validateForm.sample = data[i].sample;          //将sample和sampleid存入form表单，creatorder接口调用
							that.validateForm.sampleid = data[i].sampleid;
							that.validateForm.bhmb = data[i].samplename;
							that.validateForm.bhmbIndex = i;
						}
					}
					that.$nextTick(function(){
						that.$refs.resolve.init();
					})
				}
			})
		},

		submit() {
			var that = this;

			
			if(this.activeStep === 0){
				this.activeStep++;
				this.$refs.resolve.init();
			}else if(this.activeStep ===1){
				this.activeStep++;
			}else if(this.activeStep === 2){
				this.createOrder();
			}else{
				this.activeStep++;
			}
			
		},
		test(){
			this.validateForm.zbdlname = '22';
		},
		show(v){
			
		}

    },
    created() {
		let _this = this;
    },
    computed: {

    },
	mounted(){
		if(this.$route.query.isedit == '3'){
			this.getDetail(this.$route.query.id);
			this.curMode = "edit";
		}else{
			
		}
		
	}
};
</script>
<style lang="less" scoped>
	.container {
		padding: 16px;
	}

	.mu-form-item {
		margin-bottom: 4px;
		padding-bottom: 12px;

		.mu-button {
		margin: 0 auto;
		width: 100%;
		background-color: #f18241;
		margin-top: 20px;
		}

		.form_submit {
		color: #f18241;
		background-color: rgb(250, 250, 250);
		border:1px solid #f18241;
		box-shadow: none;
		}
	}
</style>